.class public Lcom/glympse/android/glympse/ViewFeedback;
.super Landroid/widget/ScrollView;
.source "ViewFeedback.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/android/glympse/ViewFeedback$MessageBoxListener;,
        Lcom/glympse/android/glympse/ViewFeedback$MyGlympseView;,
        Lcom/glympse/android/glympse/ViewFeedback$TextWatcherFeedback;
    }
.end annotation


# instance fields
.field private m_nCategory:I

.field private m_nRating:I

.field public m_oGlympseView:Lcom/glympse/android/glympse/ViewFeedback$MyGlympseView;

.field private m_oTextWatcherFeedback:Lcom/glympse/android/glympse/ViewFeedback$TextWatcherFeedback;

.field private m_strEmail:Ljava/lang/String;

.field private m_strFeedback:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 3
    .parameter "oContext"

    .prologue
    const/4 v2, 0x0

    const/4 v1, 0x0

    .line 47
    invoke-direct {p0, p1}, Landroid/widget/ScrollView;-><init>(Landroid/content/Context;)V

    .line 35
    new-instance v0, Lcom/glympse/android/glympse/ViewFeedback$MyGlympseView;

    invoke-direct {v0, p0}, Lcom/glympse/android/glympse/ViewFeedback$MyGlympseView;-><init>(Lcom/glympse/android/glympse/ViewFeedback;)V

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_oGlympseView:Lcom/glympse/android/glympse/ViewFeedback$MyGlympseView;

    .line 37
    iput v2, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nRating:I

    .line 38
    iput v2, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nCategory:I

    .line 39
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strFeedback:Ljava/lang/String;

    .line 40
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strEmail:Ljava/lang/String;

    .line 42
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_oTextWatcherFeedback:Lcom/glympse/android/glympse/ViewFeedback$TextWatcherFeedback;

    .line 48
    return-void
.end method

.method private ClearValues()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 101
    iput v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nRating:I

    .line 102
    iput v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nCategory:I

    .line 103
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strFeedback:Ljava/lang/String;

    .line 104
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strEmail:Ljava/lang/String;

    .line 105
    return-void
.end method

.method private DoPost()V
    .locals 6

    .prologue
    .line 178
    const/4 v0, 0x0

    .line 179
    .local v0, strCategory:Ljava/lang/String;
    iget v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nCategory:I

    packed-switch v1, :pswitch_data_0

    .line 187
    :goto_0
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "[FEEDBACK] RATE: "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v2, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nRating:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", CATEGORY: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", FEEDBACK: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strFeedback:Ljava/lang/String;

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", EMAIL: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strEmail:Ljava/lang/String;

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 190
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oJobQueue:Lcom/glympse/platform/common/JobQueue;

    new-instance v2, Lcom/glympse/platform/common/ZendeskJob;

    iget v3, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nRating:I

    iget-object v4, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strFeedback:Ljava/lang/String;

    iget-object v5, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strEmail:Ljava/lang/String;

    invoke-direct {v2, v3, v0, v4, v5}, Lcom/glympse/platform/common/ZendeskJob;-><init>(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v1, v2}, Lcom/glympse/platform/common/JobQueue;->AddJob(Lcom/glympse/platform/common/JobQueue$Job;)V

    .line 193
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->ClearValues()V

    .line 194
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->SetValues()V

    .line 197
    sget-object v1, Lcom/glympse/android/glympse/Glympse$EViews;->Feedback:Lcom/glympse/android/glympse/Glympse$EViews;

    sget-object v2, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/Glympse;->GetCurrentEView()Lcom/glympse/android/glympse/Glympse$EViews;

    move-result-object v2

    if-ne v1, v2, :cond_0

    .line 199
    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/Glympse;->PopView()Lcom/glympse/android/glympse/Glympse$EViews;

    .line 201
    :cond_0
    return-void

    .line 181
    :pswitch_0
    const-string v0, "Comment"

    goto :goto_0

    .line 182
    :pswitch_1
    const-string v0, "Question"

    goto :goto_0

    .line 183
    :pswitch_2
    const-string v0, "Suggestion"

    goto :goto_0

    .line 184
    :pswitch_3
    const-string v0, "Bug"

    goto :goto_0

    .line 179
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method

.method private GetValues()V
    .locals 1

    .prologue
    .line 131
    const v0, 0x7f0c0054

    :try_start_0
    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RatingBar;

    invoke-virtual {v0}, Landroid/widget/RatingBar;->getRating()F

    move-result v0

    float-to-int v0, v0

    iput v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nRating:I

    .line 132
    const v0, 0x7f0c0055

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Spinner;

    invoke-virtual {v0}, Landroid/widget/Spinner;->getSelectedItemPosition()I

    move-result v0

    iput v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nCategory:I

    .line 133
    const v0, 0x7f0c0056

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/EditText;

    invoke-virtual {v0}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

    invoke-interface {v0}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strEmail:Ljava/lang/String;

    .line 134
    const v0, 0x7f0c0057

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/EditText;

    invoke-virtual {v0}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

    invoke-interface {v0}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strFeedback:Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 139
    :goto_0
    return-void

    .line 136
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method private SetValues()V
    .locals 2

    .prologue
    .line 113
    const v0, 0x7f0c0054

    :try_start_0
    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RatingBar;

    iget v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nRating:I

    int-to-float v1, v1

    invoke-virtual {v0, v1}, Landroid/widget/RatingBar;->setRating(F)V

    .line 114
    const v0, 0x7f0c0055

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Spinner;

    iget v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_nCategory:I

    invoke-virtual {v0, v1}, Landroid/widget/Spinner;->setSelection(I)V

    .line 115
    const v0, 0x7f0c0056

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/EditText;

    iget-object v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strEmail:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 116
    const v0, 0x7f0c0057

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/EditText;

    iget-object v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strFeedback:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 118
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->UpdateSubmitButton()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 123
    :goto_0
    return-void

    .line 120
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method private Submit()V
    .locals 10

    .prologue
    .line 153
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->GetValues()V

    .line 156
    iget-object v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strEmail:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x2

    iget-object v1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_strEmail:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Recipient;->GuessType(Ljava/lang/String;)I

    move-result v1

    if-eq v0, v1, :cond_1

    .line 158
    :cond_0
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    .line 159
    const/4 v1, 0x0

    .line 160
    const-string v2, "PromptForFeedbackEmail"

    .line 161
    const v3, 0x7f0a007f

    .line 162
    const v4, 0x7f02004b

    .line 163
    const v5, 0x7f0a0082

    .line 164
    const v6, 0x7f0a0068

    .line 165
    const v7, 0x7f0a0069

    .line 166
    new-instance v8, Lcom/glympse/android/glympse/ViewFeedback$MessageBoxListener;

    const/4 v9, 0x0

    invoke-direct {v8, p0, v9}, Lcom/glympse/android/glympse/ViewFeedback$MessageBoxListener;-><init>(Lcom/glympse/android/glympse/ViewFeedback;Lcom/glympse/android/glympse/ViewFeedback$MessageBoxListener;)V

    .line 158
    invoke-virtual/range {v0 .. v8}, Lcom/glympse/android/glympse/Glympse;->MessageBox(ZLjava/lang/String;IIIIILcom/glympse/android/glympse/DlgShell$DlgShellListener;)V

    .line 173
    :goto_0
    return-void

    .line 171
    :cond_1
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->DoPost()V

    goto :goto_0
.end method

.method private UpdateSubmitButton()V
    .locals 5

    .prologue
    const/16 v3, 0xc0

    .line 144
    const v2, 0x7f0c0057

    invoke-virtual {p0, v2}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/EditText;

    invoke-virtual {v2}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v2

    invoke-interface {v2}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_0

    const/4 v2, 0x0

    move v0, v2

    .line 145
    .local v0, fEnabled:Z
    :goto_0
    const v2, 0x7f0c0058

    invoke-virtual {p0, v2}, Lcom/glympse/android/glympse/ViewFeedback;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/Button;

    .line 146
    .local v1, oButtonSubmit:Landroid/widget/Button;
    invoke-virtual {v1, v0}, Landroid/widget/Button;->setEnabled(Z)V

    .line 147
    if-eqz v0, :cond_1

    const/16 v2, 0x69

    const/16 v3, 0x94

    const/16 v4, 0xd9

    invoke-static {v2, v3, v4}, Landroid/graphics/Color;->rgb(III)I

    move-result v2

    :goto_1
    invoke-virtual {v1, v2}, Landroid/widget/Button;->setTextColor(I)V

    .line 148
    return-void

    .line 144
    .end local v0           #fEnabled:Z
    .end local v1           #oButtonSubmit:Landroid/widget/Button;
    :cond_0
    const/4 v2, 0x1

    move v0, v2

    goto :goto_0

    .line 147
    .restart local v0       #fEnabled:Z
    .restart local v1       #oButtonSubmit:Landroid/widget/Button;
    :cond_1
    invoke-static {v3, v3, v3}, Landroid/graphics/Color;->rgb(III)I

    move-result v2

    goto :goto_1
.end method

.method static synthetic access$0(Lcom/glympse/android/glympse/ViewFeedback;)V
    .locals 0
    .parameter

    .prologue
    .line 108
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->SetValues()V

    return-void
.end method

.method static synthetic access$1(Lcom/glympse/android/glympse/ViewFeedback;Lcom/glympse/android/glympse/ViewFeedback$TextWatcherFeedback;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 42
    iput-object p1, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_oTextWatcherFeedback:Lcom/glympse/android/glympse/ViewFeedback$TextWatcherFeedback;

    return-void
.end method

.method static synthetic access$2(Lcom/glympse/android/glympse/ViewFeedback;)V
    .locals 0
    .parameter

    .prologue
    .line 151
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->Submit()V

    return-void
.end method

.method static synthetic access$3(Lcom/glympse/android/glympse/ViewFeedback;)V
    .locals 0
    .parameter

    .prologue
    .line 126
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->GetValues()V

    return-void
.end method

.method static synthetic access$4(Lcom/glympse/android/glympse/ViewFeedback;)Lcom/glympse/android/glympse/ViewFeedback$TextWatcherFeedback;
    .locals 1
    .parameter

    .prologue
    .line 42
    iget-object v0, p0, Lcom/glympse/android/glympse/ViewFeedback;->m_oTextWatcherFeedback:Lcom/glympse/android/glympse/ViewFeedback$TextWatcherFeedback;

    return-object v0
.end method

.method static synthetic access$5(Lcom/glympse/android/glympse/ViewFeedback;)V
    .locals 0
    .parameter

    .prologue
    .line 142
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->UpdateSubmitButton()V

    return-void
.end method

.method static synthetic access$6(Lcom/glympse/android/glympse/ViewFeedback;)V
    .locals 0
    .parameter

    .prologue
    .line 176
    invoke-direct {p0}, Lcom/glympse/android/glympse/ViewFeedback;->DoPost()V

    return-void
.end method
